package com.lingnan.feign;

import com.lingnan.entity.po.Company;
import com.lingnan.entity.po.CompanyHr;
import com.lingnan.entity.po.JobSeeker;
import com.lingnan.entity.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = "user-service",path = "/user")
public interface UserFeignClient {
    /**
     * 根据用户账户ID查询求职者信息
     */
    @GetMapping("/jobSeeker/{userId}")
    public JobSeeker getJobSeekerByUserId(@PathVariable("userId") Long userId);


    /**
     * 根据用户账户ID查询公司信息
     */
    @GetMapping("/company/{userId}")
    public Company getCompanyByUserId(@PathVariable("userId") Long userId);


    /**
     * 根据用户账户ID查询HR信息
     */
    @GetMapping("/hr/{userId}")
    public Result<CompanyHr> getHrByUserId(@PathVariable("userId") Long userId);


    /**
     * 根据公司ID查询该公司的所有HR
     */
    @GetMapping("/company/{companyId}/hrs")
    public List<CompanyHr> getHrsByCompanyId(@PathVariable("companyId") Long companyId);


    /**
     * 根据HR的用户账户ID查询对应的公司信息
     */
    @GetMapping("/hr/{userId}/company")
    public Company getCompanyByHrUserId(@PathVariable("userId") Long hrId);

}
